function getPlasmidPagingColumns() {
    return [{
            name: 'indexNum',
            type: 'float'
        },
        {
            name: 'name'
        },
        {
            name: 'plasmidName'
        },
        {
            name: 'markers'
        },
        {
            name: 'yeastSelection'
        },
        {
            name: 'boxNumber'
        },
        {
            name: 'dateEntered'
        },
        {
            name: 'bacterialHost'
        },
        {
            name: 'contributor'
        },
        {
            name: 'savedBy'
        },
        {
            name: 'yeastOrigin'
        },
        {
            name: 'bacterialSelection'
        },
        {
            name: 'comments'
        },
        {
            name: 'references'
        },
        {
            name: 'position'
        },
        {
            name: 'accessionId'
        },
        {
            name: 'mta'
        },
        {
            name: 'isbBoxNumber'
        }
    ];

}

function initPlasmidJson(pHash) {
    pHash.plasmidName = undefined;
}

function getPlasmidSearchOptionsArray() {
    return [
        ['all', 'All'],
        ['plasmidKey', 'plasmidKey'],
        ['plasmidName', 'plasmidName'],
        ['markers', 'plasmidInfo'],
        ['yeastSelection', 'yeastSelection'],
        ['boxNumber', 'boxNumber'],
        ['isbBoxNumber', 'isbBoxNumber'],
        ['position', 'position'],
        ['dateEntered', 'dateEntered'],
        ['accessionId', 'accessionId'],
        ['bacterialHost', 'bacterialHost'],
        ['contributor', 'contributor'],
        ['savedBy', 'savedBy'],
        ['yeastOrigin', 'yeastOrigin'],
        ['bacterialSelection', 'bacterialSelection'],
        ['comments', 'comments'],
        ['references', 'references'],
        ['mta', 'mta']
    ];
}

function getPlasmidSearchColumnHeaders() {
    return  [{
            header: 'Index',
            width: 50,
            sortable: true,
            dataIndex: 'indexNum'
        },
        {
            id:'plasmidKey',
            header: 'Key',
            width: 80,
            sortable: true,
            dataIndex: 'name'
        },
        {
            header: 'Name',
            width: 150,
            sortable: true,
            dataIndex: 'plasmidName'
        },
        {
            header: 'Info',
            width: 200,
            sortable: true,
            dataIndex: 'markers'
        },
        {
            header: 'Yeast Selection',
            width: 80,
            sortable: true,
            dataIndex: 'yeastSelection'
        },
        {
            header: 'Box Number',
            width: 80,
            sortable: true,
            dataIndex: 'boxNumber'
        },
        {
            header: 'Date Frozen',
            width: 80,
            sortable: true,
            dataIndex: 'dateEntered'
        },
        {
            header: 'Bacterial Host',
            hidden: true,
            dataIndex: 'bacterialHost'
        },
        {
            header: 'Contributor',
            hidden: true,
            dataIndex: 'contributor'
        },
        {
            header: 'Saved By',
            hidden: true,
            dataIndex: 'savedBy'
        },
        {
            header: 'Yeast Origin',
            hidden: true,
            dataIndex: 'yeastOrigin'
        },
        {
            header: 'Bacterial Selection',
            hidden: true,
            dataIndex: 'bacterialSelection'
        },
        {
            header: 'Comments',
            hidden: true,
            dataIndex: 'comments'
        },
        {
            header: 'Position',
            hidden: true,
            dataIndex: 'position'
        },
        {
            header: 'Accession',
            hidden: true,
            dataIndex: 'accessionId'
        },
        {
            header: 'MTA',
            hidden: true,
            dataIndex: 'mta'
        }

    ];
}

function populatePlasmidJson(oHash, g) {
    oHash.name = g.getSelectionModel().getSelected().data.name;
    oHash.plasmidName = g.getSelectionModel().getSelected().data.plasmidName;
    oHash.markers = g.getSelectionModel().getSelected().data.markers;
    oHash.yeastSelection = g.getSelectionModel().getSelected().data.yeastSelection;
    oHash.boxNumber = g.getSelectionModel().getSelected().data.boxNumber;
    oHash.isbBoxNumber = g.getSelectionModel().getSelected().data.isbBoxNumber;
    oHash.position = g.getSelectionModel().getSelected().data.position;
    oHash.dateEntered = g.getSelectionModel().getSelected().data.dateEntered;
    oHash.bacterialHost = g.getSelectionModel().getSelected().data.bacterialHost;
    oHash.contributor = g.getSelectionModel().getSelected().data.contributor;
    oHash.savedBy = g.getSelectionModel().getSelected().data.savedBy;
    oHash.yeastOrigin = g.getSelectionModel().getSelected().data.yeastOrigin;
    oHash.bacterialSelection = g.getSelectionModel().getSelected().data.bacterialSelection;
    oHash.comments = g.getSelectionModel().getSelected().data.comments;
    oHash.references = g.getSelectionModel().getSelected().data.references;
    oHash.mta = g.getSelectionModel().getSelected().data.mta;
    oHash.accessionId = g.getSelectionModel().getSelected().data.accessionId;
}


function validateCreateUpdatePlasmid() {

    /*if (Ext.getCmp("plasmidNameId").getValue() == null || Ext.getCmp("plasmidNameId").getValue() == "") {
     Ext.Msg.alert('Error', 'Plasmid name is required.');
     return false;
     } else if (Ext.getCmp("markersId").getValue() == null || Ext.getCmp("markersId").getValue() == "") {
     Ext.Msg.alert('Error', 'Plasmid info field is required.');
     return false;
     }else if (Ext.getCmp("yeastSelectionId").getValue() == null || Ext.getCmp("yeastSelectionId").getValue() == "") {
     Ext.Msg.alert('Error', 'Yeast selection field is required.');
     return false;
     }else if (Ext.getCmp("yeastOriginId").getValue() == null || Ext.getCmp("yeastOriginId").getValue() == "") {
     Ext.Msg.alert('Error', 'Yeast origin is required.');
     return false;
     }else if (Ext.getCmp("bacterialSelectionId").getValue() == null || Ext.getCmp("bacterialSelectionId").getValue() == "") {
     Ext.Msg.alert('Error', 'Bacterial Selection field is required.');
     return false;
     }*/

    return true;
}

